//
// Created by miaomiaole on 2023/6/6.
//

#ifndef CMAKECXX_UNORDERED_CONTAINER_H
#define CMAKECXX_UNORDERED_CONTAINER_H

void unordered_print();


class Customer {
private:
    std::string fname;
    std::string lname;
    long num;
public:
    Customer(const std::string &fn, const std::string &ln, long n) : fname(fn), lname(ln), num(n) {};


    friend std::ostream &operator<<(std::ostream &strm, const Customer &customerHash) {
        return strm << "[" << customerHash.fname << ", " << customerHash.lname << ","
                    << customerHash.num << " ]";
    }
};

class CustomerHash {
public:
    std::size_t operator()(const Customer &c) const {
    }
};


class Item_ref {
private:
    std::string name;
    float price;
public:
    Item_ref(const std::string &str, float p = 0) : name(str), price(p) {
        std::cout << "generate Item_ref " << std::endl;
    }

    std::string getName() const {
        return name;
    }

    void setName(const std::string &n) {
        name = n;
    }

    float getPrice() const {
        return price;
    }

    void setPrice(float price) {
        Item_ref::price = price;
    }
};

template<typename Coll>
void printItems(const std::string &msg, const Coll &coll) {
    std::cout << msg << std::endl;
    for (const auto &elem: coll) {
        std::cout << "  " << elem->getName() << " " << elem->getPrice() << std::endl;
    }
}

void reference_wrapper();

#endif //CMAKECXX_UNORDERED_CONTAINER_H
